/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.entity;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品规格内容Entity
 * @author ruyang
 * @version 2020-12-04
 */
@Table(name="ms_goods_spec_val", alias="a", columns={
		@Column(name="spec_val_id", attrName="specValId", label="类型编码", isPK=true),
		@Column(name="goods_id", attrName="goodsId", label="商品id"),
		@Column(name="key", attrName="key", label="规格键名"),
		@Column(name="key_name", attrName="keyName", label="规格键名中文", queryType=QueryType.LIKE),
		@Column(name="shop_price", attrName="shopPrice", label="价格", comment="价格(供货价格)"),
		@Column(name="market_price", attrName="marketPrice", label="零售价格"),
		@Column(name="store_count", attrName="storeCount", label="库存数量"),
		@Column(name="bar_code", attrName="barCode", label="商品条形码"),
		@Column(name="sku", attrName="sku", label="SKU"),
		@Column(name="thumbnail", attrName="thumbnail", label="商品缩略图"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class GoodsSpecVal extends DataEntity<GoodsSpecVal> {
	
	private static final long serialVersionUID = 1L;
	private String specValId;		// 类型编码
	private String goodsId;		// 商品id
	private String key;		// 规格键名
	private String keyName;		// 规格键名中文
	private Double shopPrice;		// 价格(供货价格)
	private Double marketPrice;		// 零售价格
	private Long storeCount;		// 库存数量
	private String barCode;		// 商品条形码
	private String sku;		// SKU
	private String thumbnail;		// 商品缩略图
	
	public GoodsSpecVal() {
		this(null);
	}

	public GoodsSpecVal(String id){
		super(id);
	}
	
	public String getSpecValId() {
		return specValId;
	}

	public void setSpecValId(String specValId) {
		this.specValId = specValId;
	}
	
	@Length(min=0, max=128, message="商品id长度不能超过 128 个字符")
	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}
	
	@Length(min=0, max=255, message="规格键名长度不能超过 255 个字符")
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
	
	@Length(min=0, max=255, message="规格键名中文长度不能超过 255 个字符")
	public String getKeyName() {
		return keyName;
	}

	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}
	
	public Double getShopPrice() {
		return shopPrice;
	}

	public void setShopPrice(Double shopPrice) {
		this.shopPrice = shopPrice;
	}
	
	public Double getMarketPrice() {
		return marketPrice;
	}

	public void setMarketPrice(Double marketPrice) {
		this.marketPrice = marketPrice;
	}
	
	public Long getStoreCount() {
		return storeCount;
	}

	public void setStoreCount(Long storeCount) {
		this.storeCount = storeCount;
	}
	
	@Length(min=0, max=32, message="商品条形码长度不能超过 32 个字符")
	public String getBarCode() {
		return barCode;
	}

	public void setBarCode(String barCode) {
		this.barCode = barCode;
	}
	
	@Length(min=0, max=128, message="SKU长度不能超过 128 个字符")
	public String getSku() {
		return sku;
	}

	public void setSku(String sku) {
		this.sku = sku;
	}
	
	@Length(min=0, max=255, message="商品缩略图长度不能超过 255 个字符")
	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	
}